<template>
    <ul>
        <li v-for="liveList in data">
            <router-link to>
                <div class="person">
                    <p :style="{backgroundImage:'url('+liveList.personImg+')'}"></p>
                    <span>{{liveList.name}}</span>
                </div>
                <div class="wrap" :style="{backgroundImage:'url('+liveList.bg+')'}">
                    <div class="content">
                        <div class="left">
                            <p class="living">
                                <b></b>
                                <span class="txt">直播中</span>
                                <u></u>
                                <span>{{liveList.visitNum}}W</span>
                            </p>
                            <p class="title">{{liveList.title}}</p>
                            <div>
                                <div
                                    v-for="item in liveList.shopList"
                                    :style="{backgroundImage:'url('+item.img+')'}"
                                >
                                    <p>{{item.price}}</p>
                                </div>
                            </div>
                        </div>
                        <ol class="right">
                            <li v-for="item in liveList.barrage">
                                <i :style="{backgroundImage:'url('+item.img+')'}"></i>
                                <span>{{item.content}}</span>
                            </li>
                        </ol>
                    </div>
                </div>
            </router-link>
        </li>
    </ul>
</template>

<script>
export default {
    props: ["data"]
};
</script>

<style scoped lang="scss">
ul {
    margin: 10px 10px 50px;
    width: 95%;
    & > li {
        width: 100%;
        margin-bottom: 10px;

        a {
            text-decoration: none;
        }
    }
    .person {
        position: relative;
        z-index: 1;
        color: black;
        p {
            width: 50px;
            height: 50px;
            display: inline-block;
            border-radius: 50%;
            border: 3px solid white;
            background-size: contain;
            vertical-align: middle;
        }
    }
    .wrap {
        position: relative;
        top: -10px;
        background-repeat: no-repeat;
        background-size: 100% 100%;
        .content {
            padding: 10px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            padding-top: 100px;
            background-image: linear-gradient(
                transparent 50%,
                rgba(0, 0, 0, 0.527)
            );
        }
        .living {
            display: inline-block;
            font-size: 10px;
            padding: 3px 5px;
            border-radius: 3px;
            color: white;
            background-color: rgba(0, 0, 0, 0.288);
            b {
                display: inline-block;
                width: 8px;
                height: 8px;
                border-radius: 50%;
                background-color: red;
                animation: dot 1.5s infinite;
            }
            @keyframes dot {
                from {
                    opacity: 1;
                }
                to {
                    opacity: 0;
                }
            }
            .txt {
                padding-right: 5px;
                border-right: 1px solid rgba(255, 255, 255, 0.335);
            }
            u {
                display: inline-block;
                width: 10px;
                height: 10px;
                background: url("../../assets/images/live/live-fire.png")
                    no-repeat center/cover;
            }
        }
        .title {
            color: white;
            margin: 10px 0;
        }
        .left {
            width: 60%;
            & > div {
                display: flex;
                width: 100%;
                justify-content: space-between;
                & > div {
                    width: 65px;
                    height: 65px;
                    background-size: contain;
                    p {
                        font-size: 10px;
                        padding-top: 53px;
                        color: white;
                        background-image: linear-gradient(
                            transparent 50%,
                            rgba(0, 0, 0, 0.349),
                            rgba(0, 0, 0, 0.767)
                        );
                    }
                }
            }
        }
        .right {
            font-size: 10px;
            padding-top: 68px;
            opacity: 0.8;
            li {
                margin-bottom: 5px;
            }
            i {
                display: inline-block;
                width: 12px;
                height: 12px;
                border-radius: 50%;
                background-size: contain;
                vertical-align: middle;
            }
            span {
                color: white;
            }
        }
    }
}
</style>